package com.sskj.mine.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.bean.SpreadTitleBean;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.ui.activity.SpreadMenuActivity;


public class SpreadMenuActivityPresenter extends BasePresenter<SpreadMenuActivity> {

    public void getData() {
        httpService.getSpreadTitle("1", "15")
                .execute(new JsonCallBack<HttpData<SpreadTitleBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<SpreadTitleBean>> response) {
                        HttpData<SpreadTitleBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateUI(httpData.getData());
                        }
                    }
                });
    }
}
